#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/7/26 11:53
# @Author  : ldh
from time import sleep

from basic.UIParent import UIParent
from basic.utils.readConfig.GetConfigValue import GetValue
from commen.page.agx.AGXLoginPage import AGXLoginPage
from commen.page.agx.AGXMyPage import AGXMyPage


class AGXLogin(UIParent):
    '''登录校验'''
    @classmethod
    def test_agxLoginByPwd(cls):
        # 打开我的页面，判断是否已登录
        AGXMyPage.openMyPage()
        if AGXMyPage.ifLogin()==True:
            print("您已登录！")
            AGXMyPage.getUserID()
        else:
            print("您尚未登录！")
            #使用账号+密码登录
            AGXLoginPage.loginByPwd(GetValue.read("login", "agx_phone"),GetValue.read("login", "agx_pwd"))
            sleep(5)
            AGXMyPage.getUserID()





